GtkApplication: lock gdk on incoming messages
authorRyan Lortie <desrt@desrt.ca>
Sat, 17 Dec 2011 06:00:38 +0000 (01:00 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Dec 2011 17:51:12 +0000 (12:51 -0500)
When we have incoming activations or action invocations we should
acquire the GDK lock, just in case the program in question is using gdk
threads.

https://bugzilla.gnome.org/show_bug.cgi?id=665737

gtk/gtkapplication.c

index 1b5f2a665c645e03058153cdc4c2a632cf42825c..307ee6f84bde58bf2beba8d3c2a34996128d7fbf 100644 (file)
@@ -322,6 +322,8 @@ gtk_application_before_emit (GApplication *application,
   const gchar *key;
   GVariant *value;
 
+  gdk_threads_enter ();
+
   g_variant_iter_init (&iter, platform_data);
   while (g_variant_iter_loop (&iter, "{&sv}", &key, &value))
     {
@@ -345,6 +347,8 @@ gtk_application_after_emit (GApplication *application,
                             GVariant     *platform_data)
 {
   gdk_notify_startup_complete ();
+
+  gdk_threads_leave ();
 }
 
 static void